import { useCachedVideoStoreHook } from "@/store/modules/cachedVideo";
export default function useVideo() {
  const cachedVideoStore = useCachedVideoStoreHook();
  const loadVideo = () => {
    cachedVideoStore.fetchVideos();
  };

  onMounted(() => {
    if (!cachedVideoStore.cachedVideoList.length) {
      loadVideo();
    }
  });

  const videoList = computed(() => cachedVideoStore.tabVideoList);
  const videoLoadMoreStatus = computed(
    () => cachedVideoStore.videoLoadMoreStatus
  );

  return { videoList, loadVideo, videoLoadMoreStatus };
}
